package com.eee.machine.controller;


import com.eee.machine.common.OperateResponse;
import com.eee.machine.common.TableData;
import com.eee.machine.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private IOrderService orderService;


    @RequestMapping("/getAllTrades")
    @ResponseBody
    TableData getAllTrades(@RequestParam(value = "page") String page,
                           @RequestParam(value = "limit") String limit){
        return orderService.getOrderList(Long.parseLong(page), Long.parseLong(limit));
    }


    @RequestMapping("/refundSell")
    @ResponseBody
    OperateResponse refundSell(String tid, Float refundFee, String desc, String oid){
        return orderService.refundSell(tid, refundFee, desc, oid);
    }
}
